package factory.factory;

import factory.impl.Circle;
import factory.impl.Square;
import factory.interf.Shape;

/**
 * @ClassName ColorFactory
 * @Description TODO
 * @Author 马继斌
 * @Email 1423553596@qq.com
 * @Date 18-8-28 上午4:57
 **/
public class ShapeFactory {
    /**
     * 返回Shape对象
     * @param shapeType  表示 Shape 类型
     * @return
     */
    public Shape getShape(String shapeType){
        if(shapeType == null){
            return null;
        }
        if(shapeType.equalsIgnoreCase("CIRCLE")){
            return new Circle();
        }
        else if(shapeType.equalsIgnoreCase("SQUARE")){
            return new Square();
        }
        return null;
    }
}
